﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PP.PPPoker
{
    /// <summary>
    /// GameLogicConfig 游戏逻辑相关的配置
    /// FromLua: LogicConfig.lua
    /// </summary>
    public class GameLogicConfig
    {
        public const int MIN_BLIND_DEPTH = 20;
        public const int MAX_BLIND_DEPTH = 500;
        public const int DIS_BLIND_DEPTH = MAX_BLIND_DEPTH - MIN_BLIND_DEPTH;

        /// <summary>
        /// 开桌: 小时数
        /// </summary>
        public static Dictionary<int, float> ROOM_TIME = new Dictionary<int, float>()
        {
            {1, 0.5f},
            {2, 1f},
            {3, 2f},
            {4, 3f},
            {5, 5f},
            {6, 8f},
            {7, 12f}
        };

        /// <summary>
        /// 开桌：分钟数
        /// </summary>
        public static Dictionary<int, int> ROOM_TIME_TO_MINUTE = new Dictionary<int, int>()
        {
	        {1, 30},
	        {2, 60},
	        {3, 120},
	        {4, 180},
	        {5, 300},
	        {6, 480},
	        {7, 720},
	        {8, 1440},
		};

		public static Dictionary<int, float> ROOM_TIME_MINUTES = new Dictionary<int, float>()
        {
            {1, 15},
            {2, 30},
            {3, 45},
            {4, 60}
        };

        /// <summary>
        /// 开桌：行动时间 秒数
        /// </summary>
        public static Dictionary<int, int> ACTION_TIME = new Dictionary<int, int>()
        {
            {1, 15},
            {2, 20},
            {3, 30}
        };

        public static Dictionary<int, int> SPINUP_ACTION_TIME = new Dictionary<int, int>()
        {
            {1, 10},
            {2, 15},
            {3, 20}
        };

        public static Dictionary<int, int> AOF_ACTION_TIME = new Dictionary<int, int>()
        {
            {1, 10},
            {2, 15},
            {3, 20}
        };

        public static Dictionary<int, int> TP_ACTION_TIME = new Dictionary<int, int>()
        {
            {1, 10},
            {2, 15},
            {3, 20}
        };

        public static Dictionary<int, int> SEKA_CARDS_MODE = new Dictionary<int, int>()
        {
            {1, 700},
            {2, 701},
            {3, 702}
        };

        public static Dictionary<int, int> SEKA_ACTION_TIME = new Dictionary<int, int>()
        {
            {1, 10},
            {2, 15},
            {3, 20}
        };

        //
        public static Dictionary<int, float> COLOR_GAME_ROOM_TIME = new Dictionary<int, float>()
        {
            {1, 0.5f},
            {2, 1},
            {3, 2},
            {4, 3},
            {5, 5},
            {6, 8},
            {7, 12},
            {8, 24}
        };

        [Obsolete("Use GameActionType instead")]
        public static Dictionary<int, string> ACTION_NUM2SZ = new Dictionary<int, string>()
        {
            {1, "ACTION_FOLD"},
            {2, "ACTION_CHECK"},
            {3, "ACTION_CALL"},
            {4, "ACTION_RAISE"},
            {5, "ACTION_WAIT"},
            {6, "ACTION_SITED"},
            {7, "ACTION_BET"},
            {8, "ACTION_SB"},
            {9, "ACTION_BB"},
            {10, "ACTION_ANTE"},
            {11, "ACTION_FORCE_BB"},
            {12, "ACTION_SYSTEM_FOLD"},
            {13, "ACTION_SYSTEM_CHECK"},
            {14, "ACTION_STRADDLE"},
            {15, "ACTION_POT"},
            {17, "ACTION_BOMB_POT"}
        };

        public static Dictionary<int, string> ROUND_STAGE = new Dictionary<int, string>()
        {
            {1, "none"},
            {2, "preFlop"},
            {3, "flop"},
            {4, "turn"},
            {5, "river"},
            {6, "over"}
        };

        public const int DEFAULT_QUICK_BLIND = 4;
        public const int DEFAULT_QUICK_ANTE = 1;
        public const int DEFAULT_QUICK_ANTE_2 = 4;
        public const int DEFAULT_QUICK_AOF_BUY_IN = 3;
        public const int DEFAULT_QUICK_TEEN_PATTI_ANTE = 4;
        public const int DEFAULT_QUICK_TEEN_PATTI_ANTE_2 = 8;

        public static Dictionary<int, int> QUICK_BLIND_TYPE = new Dictionary<int, int>()
        {
            {1, 20},
            {2, 25},
            {3, 30},
            {4, 40},
            {5, 50},
            {6, 60},
            {7, 80},
            {8, 100},
            {9, 150},
            {10, 200},
            {11, 250},
            {12, 300},
            {13, 350},
            {14, 400},
            {15, 450},
            {16, 500}
        };

        public static Dictionary<int, int> QUICK_AOF_BLIND_TYPE = new Dictionary<int, int>()
        {
            {1, 6},
            {2, 7},
            {3, 8},
            {4, 9},
            {5, 10},
            {6, 11},
            {7, 12},
            {8, 13},
            {9, 14},
            {10, 15},
            {11, 16},
            {12, 17},
            {13, 18},
            {14, 19},
            {15, 20}
        };

        public static Dictionary<int, int> QUICK_ANTE_TYPE = new Dictionary<int, int>()
        {
            {1, 50},
            {2, 100},
            {3, 150},
            {4, 200},
            {5, 250},
            {6, 300},
            {7, 400},
            {8, 500}
        };

        public static readonly Dictionary<int, int> QUICK_TEEN_PATTI_ANTE_TYPE = new Dictionary<int, int>()
        {
            {1, 40},
            {2, 60},
            {3, 80},
            {4, 100},
            {5, 200},
            {6, 300},
            {7, 400},
            {8, 500},
            {9, 600},
            {10, 700},
            {11, 800},
            {12, 900},
            {13, 1000}
        };

        public static readonly Dictionary<int, int> QUICK_TEEN_PATTI_BOOST = new Dictionary<int, int>()
        {
            {1, 100},
            {2, 200},
            {3, 400},
            {4, 500},
            {5, 800},
            {6, 1000},
            {7, 2000},
            {8, 4000},
            {9, 5000},
            {10, 8000},
            {11, 10000},
            {12, 20000},
            {13, 40000},
            {14, 50000},
            {15, 80000},
            {16, 100000}
        };

        public static readonly Dictionary<int, int> QUICK_SEKA_ANTE = new Dictionary<int, int>()
        {
            {1, 10},
            {2, 20},
            {3, 50},
            {4, 100},
            {5, 200},
            {6, 500},
            {7, 1000},
            {8, 2000},
            {9, 5000},
            {10, 10000},
            {11, 20000},
            {12, 50000}
        };

        public static readonly Dictionary<int, int> AUTO_DELAY_TIMES = new Dictionary<int, int>()
        {
            {1, 1},
            {2, 2},
            {3, 3},
            {4, 5},
            {5, 8},
            {6, 10},
            {7, 12},
            {8, 24}
        };

        public static readonly Dictionary<int, int> SEVEN_DEUCE_BIG_BLIND = new Dictionary<int, int>()
        {
            {1, 1},
            {2, 2},
            {3, 3},
            {4, 4},
            {5, 5}
        };

        // 貴賓桌 (高價桌) 籌碼餘額限制 拉桿:
        // 不限制、5、10、20、25、30、40、50、60、80、100、150、200、250、300、350、400、450、500
        public static readonly Dictionary<int, int> HIGH_TABLE_CHIP_LIMIT = new Dictionary<int, int>()
        {
            {1, 0}, // 不限制
            {2, 5},
            {3, 10},
            {4, 20},
            {5, 25},
            {6, 30},
            {7, 40},
            {8, 50},
            {9, 60},
            {10, 80},
            {11, 100},
            {12, 150},
            {13, 200},
            {14, 250},
            {15, 300},
            {16, 350},
            {17, 400},
            {18, 450},
            {19, 500}
        };

        public static readonly List<int> VPIP_STEPS = new List<int>()
        {
            15, 18, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70
        };

        public static readonly List<int> VPIP_HAND_NUM = new List<int>()
        {
            10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80
        };



        // Calltime 时长选项
        public static List<int> CALLTIME = new List<int> { 15, 20, 30, 45, 60, 75, 90, 120, 180, 240 };

        // BOMBPOT 手牌循环
        public static Dictionary<int, int> BOMBPOT_SLIDER_HANDS = new Dictionary<int, int>
        {
            { 1, 1 },
            { 2, 2 },
            { 3, 3 },
            { 4, 4 },
            { 5, 5 },
            { 6, 6 },
            { 7, 7 },
            { 8, 8 },
            { 9, 9 },
            { 10, 10 },
            { 11, 11 },
            { 12, 12 },
            { 13, 13 },
            { 14, 14 },
            { 15, 15 },
            { 16, 16 },
            { 17, 17 },
            { 18, 18 },
            { 19, 19 },
            { 20, 20 }
        };

        // BOMBPOT BB倍数
        public static Dictionary<int, int> BOMBPOT_SLIDER_BBTIMES = new Dictionary<int, int>
        {
            { 1, 1 },
            { 2, 2 },
            { 3, 3 },
            { 4, 4 },
            { 5, 5 },
            { 6, 6 },
            { 7, 7 },
            { 8, 8 },
            { 9, 9 },
            { 10, 10 },
            { 11, 15 },
            { 12, 20 },
            { 13, 25 },
            { 14, 30 }
        };

        // 魷魚遊戲 開始人數
        public static Dictionary<int, int> SQUID_SLIDER_STARTS = new Dictionary<int, int>
        {
            { 1, 4 },
            { 2, 5 },
            { 3, 6 },
            { 4, 7 },
            { 5, 8 },
            { 6, 9 }
        };

        // 魷魚遊戲 標誌次數
        public static Dictionary<int, int> SQUID_SLIDER_TOKENS = new Dictionary<int, int>
        {
            { 1, 1 },
            { 2, 2 },
            { 3, 3 }
        };

        // 魷魚遊戲 BB倍數
        public static Dictionary<int, int> SQUID_SLIDER_BBTIMES = new Dictionary<int, int>
        {
            { 1, 2 },
            { 2, 3 },
            { 3, 4 },
            { 4, 5 }
        };
    }

    // Calltime 运作类型
    // CALLTIME_OP_TYPE
    public enum CalltimeOpType
    {
        PROFIT_MANUAL = 0, // 盈利后,手动执行 Calltime
        PROFIT_AUTO = 1, // 盈利后,自动 Calltime
        ONCE_SITDOWN = 2, // 坐下后, 自动 Calltime (限时桌)
        HAND_COUNT = 3, //  手數
	}

    public enum SpinUpBRCType
    {
        SPINUP_BRC_TYPE_NONE = 0, // none
        SPINUP_BRC_TYPE_START_DRAW_LOTTERY = 1, // 开始摇奖
        SPINUP_BRC_TYPE_RESULT_DRAW_LOTTERY = 2, // 摇奖结果
        SPINUP_BRC_TYPE_NOW_START_GAME = 3, // 现在开始游戏
        SPINUP_BRC_TYPE_REDRAW_LOTTERY = 4, // 重新摇奖
        SPINUP_BRC_TYPE_REJECT_REDRAW_LOTTERY = 5, // 拒绝重新摇奖
        SPINUP_BRC_TYPE_READY_DRAW_LOTTERY = 6 // 准备摇奖
    }

    public enum SpinUpDrawLotteryItemType
    {
        SPINUP_DRAW_LOTTERY_ITME_TYPE_GOLD = 1, // 金币
        SPINUP_DRAW_LOTTERY_ITME_TYPE_ITEM = 2, // 物品
        DRAW_LOTTERY_ITME_TYPE_SOCRE = 3, // score
        DRAW_LOTTERY_ITME_TYPE_REBATE = 4, // rebate
        SPINUP_DRAW_LOTTERY_ITME_TYPE_PPCHIP = 5 // rebate
    }
}
